package collection;

import java.util.*;

/**集合的排序 */
public class SortInteger {
    public static void main(String[] args) {
        Random ran=new Random();
        List<Integer> list=new ArrayList<>();
        for (int i=0;i<10;i++){
            list.add(ran.nextInt(100));
        }
        System.out.println("原始数据："+list);
        Collections.sort(list);
        System.out.println("排序数据："+list);
        Collections.reverse(list);//反转数据
        System.out.println("反转数据："+list);
    }
}
